import request from "../utils/request";
import utils from "../utils/util.js";
export default {
	/**
	 * 签到
	 * @param {*} data
	 * @returns
	 */
	addSign(data) {
		return request.post("/pet/signInfo/add1", data);
	},

	/**
	 * 获取签到列表
	 * @param {*} date
	 * @returns
	 */
	getSignList(date, startDate, endDate) {
		return request.get(`/pet/signInfo/list1?date=${date}&startDate=${startDate}&endDate=${endDate}`);
	},

	/**
	 * 获取用户信息
	 * @returns
	 */
	getUserInfo(id) {
		return request.get(`/pet/pUser/${id}`);
	},

	/**
	 * 更新用户信息
	 * @returns
	 */
	updateUserInfo(data) {
		return request.request(`/pet/pUser`, "PUT", data);
	},

	/**
	 * 新增地址
	 * @param {*} data
	 * @returns
	 */
	addAddress(data) {
		return request.post(`/pet/userAddress`, data);
	},

	/**
	 * 修改地址
	 * @param {*} data
	 * @returns
	 */
	updateAddress(data) {
		return request.request(`/pet/userAddress`, "PUT", data);
	},

	/**
	 * 获取地址列表
	 * @returns
	 */
	getAddressList() {
		return request.get("/pet/userAddress/list1");
	},

	/**
	 * 获取地址信息
	 */
	getAddressDetailById(id) {
		return request.get(`/pet/userAddress/${id}`)
	},

	/**
	 * 获取粉丝列表
	 * @param {*} query
	 * @returns
	 */
	getFansList(query) {
		const queryParmas = utils.addParamsToURL(query);
		return request.get(`/system/fans/list?${queryParmas}`);
	},

	/**
	 * 获取收藏或喜欢的帖子列表
	 * @param {*} query
	 * @returns
	 */
	getCollectOrLickTieziList(query) {
		const queryParmas = utils.addParamsToURL(query);
		return request.get(`/system/collect/list?${queryParmas}`);
	},

	/**
	 * 获取获赞数量
	 */
	getLikeOrFensNum(userId) {
		return request.get(`/system/collect/queryNum?userId=${userId}`)
	},
	/**
	 * 我的申请 /pet/recommendations/queryMyApply
	 */
	queryMyApply(query = {}) {
		const queryParmas = utils.addParamsToURL(query);
		return request.get(`/pet/recommendations/queryMyApply?${queryParmas}`)
	},

	/**
	 * 我的发布 /pet/recommendations/queryMyPosts
	 */
	queryMyPosts(query = {}) {
		const queryParmas = utils.addParamsToURL(query);
		return request.get(`/pet/recommendations/queryMyPosts?${queryParmas}`)
	},

	/**
	 * 推荐 /pet/recommendations
	 */
	queryRecommendations(query = {}) {
		const queryParmas = utils.addParamsToURL(query);
		return request.get(`/pet/recommendations?${queryParmas}`)
	},

	/**
	 * 获取消息记录 /system/history/list
	 */
	getMessageHistoryList(toUserId, query) {
		const queryParmas = utils.addParamsToURL(query);
		return request.get(`/system/history/queryChatHistory/${toUserId}?${queryParmas}`)
	},

	/**
	 * 消息列表 /system/history/queryChatList
	 */
	queryChatList() {
		return request.get(`/system/history/queryChatList`)
	},
	/**
	 * 互动消息/system/recording/list
	 */
	getRecordingList(query) {
		const queryParmas = utils.addParamsToURL(query);
		return request.get(`/system/recording/list?${queryParmas}`)
	}
};